<% @main_header = "#{link_to('Ptrack:', '/')} #{link_to @project.name,
'/projects/' + @project.id.to_s} : #{@task.name}" %>

<% @title = "Create A New Task" %>

<%= error_messages_for 'task',:header_message=>nil,:class=>'error' %>
<%= display_messages_for_all %>
<% form_for @task, :url => {:action => 'create'}, :html =>
  { :multipart => true} do |f| %>
  <table>
    <tr>
      <td><%= f.label 'name', 'Task Name: (required)' %></td>
      <td><%= f.text_field 'name', :size => 60 %></td>
    </tr>
    <tr>
      <td><%= f.label 'description', 'Task Description' %></td>
      <td><%= f.text_area 'description', :size => '20x10',
        :style => "height: 60px; width: 383px" %></td>
    </tr>
    <tr>
      <td><%= f.label 'keywords', 'Task keywords' %></td>
      <td><%= f.text_field 'keywords', :size => 60 %></td>
    </tr>
    <tr>
      <td><%= f.label 'start_date', 'Expected Start Date' %></td>
      <td><%= f.text_field 'start_date', :size => 20, :id => 'start_date' %></td>
    </tr>
    <tr>
      <td><%= f.label 'end_date', 'Due Date' %></td>
      <td><%= f.text_field 'end_date', :size => 20, :id => 'end_date' %></td>
    </tr>
    <tr>
      <td><%= f.label 'projected_time', 'Estimated Time' %></td>
      <td><%= f.text_field 'projected_time', :size => 20 %>
        <%= select_tag 'day_hour[]', '<option value="h">hour(s)</option>
        <option value="d">day(s)</option>' %></td>
    </tr>
    <tr>
      <td><%= f.label 'activity_id', 'Phase (required)' %></td>
      <td><%= select 'task', 'activity_id',
          @project_phases.collect {|p| [p.phase.name, p.id]},
          { :include_blank => true } %></td>
    </tr>
    <tr>
      <td><%= f.label 'assigned_to', 'Assign to' %></td>
      <td><%= select('task', 'assigned_to', @people) unless @people.blank? %></td>
    </tr>
    <tr>
      <td><%= f.label 'task', 'Related Document' %></td>
      <td><%= f.text_field 'document' %></td>
    </tr>

    <tr>
      <td>&nbsp;</td>
      <td><%= submit_tag 'Create' %> </td>
    </tr>
  </table>
<% end %>
